//#ifdef GrandCPU2012EWW
 #ifndef MacrosPortsH
  #define MacrosPortsH


/****************************************************************************************************/
/*                          P O W E R   M A N A G E M E N T   M A C R O S                           */
/****************************************************************************************************/
  #define EN24Von     ( FIO0SET = en24v   )
  #define EN24Voff    ( FIO0CLR = en24v   )
  #define PWR1on      ( FIO3CLR = pwr1    )
  #define PWR1off     ( FIO3SET = pwr1    )
  #define PWR2on      ( FIO3CLR = pwr2    )
  #define PWR2off     ( FIO3SET = pwr2    )
  #define PWR3on      ( FIO3CLR = pwr3    )
  #define PWR3off     ( FIO3SET = pwr3    )
  #define PWR4on      ( FIO4CLR = pwr4    )
  #define PWR4off     ( FIO4SET = pwr4    )
  #define PWR5on      ( FIO0CLR = pwr5    )
  #define PWR5off     ( FIO0SET = pwr5    )
  #define PWR6on      ( FIO1CLR = pwr6    )
  #define PWR6off     ( FIO1SET = pwr6    )
  #define PWR8on      ( FIO3CLR = pwr8    )
  #define PWR8off     ( FIO3SET = pwr8    )
  #define askACgood   ( FIO1PIN & acgood  )
  #define askPWROK    ( FIO2PIN & pwrok   )
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/



/****************************************************************************************************/
/*                            L E D   M A N A G E M E N T   M A C R O S                             */
/****************************************************************************************************/
  #define STATon      ( FIO1SET = status  )
  #define STAToff     ( FIO1CLR = status  )
  #define OPCon       ( FIO1SET = opc     )
  #define OPCoff      ( FIO1CLR = opc     )
  #define RLEVon      ( FIO1SET = rxlev   )
  #define RLEVoff     ( FIO1CLR = rxlev   )
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/



/****************************************************************************************************/
/*                           U A R T 0   M A N A G E M E N T   M A C R O S                          */
/****************************************************************************************************/
  #define RTS0on      ( FIO0CLR = rts0    )
  #define RTS0off     ( FIO0SET = rts0    )
  #define askCTS0     ( FIO0PIN & cts0    )
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/



/****************************************************************************************************/
/*                           U A R T 2   M A N A G E M E N T   M A C R O S                          */
/****************************************************************************************************/
  #define RTS2on      ( FIO0CLR = rts2    )
  #define RTS2off     ( FIO0SET = rts2    )
  #define askCTS2     ( FIO0PIN & cts2    )
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/



/****************************************************************************************************/
/*                           U A R T 3   M A N A G E M E N T   M A C R O S                          */
/****************************************************************************************************/
  #define RTS3on      ( FIO1CLR = rts3    )
  #define RTS3off     ( FIO1SET = rts3    )
  #define RTS3_485off    ( RTS3on    )
  #define RTS3_485on     ( RTS3off   )
  #define U3_485_DE   ( RTS3off           )
  #define U3_485_RE   ( RTS3on            )

/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/




/****************************************************************************************************/
/*                              G S M   M A N A G E M E N T   M A C R O S                           */
/****************************************************************************************************/
  #define GSMPon      ( FIO1CLR = gsmpon  )
  #define GSMPoff     ( FIO1SET = gsmpon  )
  #define GSMKEYon    ( FIO2CLR = gsmkey  )
  #define GSMKEYoff   ( FIO2SET = gsmkey  )
  #define GSMSIM1     ( FIO2CLR = gsmsim  )
  #define GSMSIM2     ( FIO2SET = gsmsim  )
  #define askGSMSTAT  ( FIO2PIN & gsmstat )
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/



/****************************************************************************************************/
/*                       E T H E R N E T   M A N A G E M E N T   M A C R O S                        */
/****************************************************************************************************/
  #define EPWRon      ( FIO4CLR = epwron  )
  #define EPWRoff     ( FIO4SET = epwron  )
  #define askERDV     ( FIO2PIN & erxdv   )
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/



/****************************************************************************************************/
/*                             D I S C R E T   I N P U T S   M A C R O S                            */
/****************************************************************************************************/
  #define askCOVER1   ( FIO1PIN & cover1  )
  #define askCOVER2   ( FIO1PIN & cover2  )
  #define askDI1      ( FIO1PIN & di1     )
  #define askDI2      ( FIO1PIN & di2     )
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/



/****************************************************************************************************/
/*                           M I S C E L L A N E O U S    M A C R O S                               */
/****************************************************************************************************/
  #define SMBAon      ( FIO2CLR = smba    )
  #define SMBAoff     ( FIO2SET = smba    )
  #define askSDCD     ( FIO0PIN & sdcd    )
  #define askBOOT     ( FIO2PIN & boot    )
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/



/****************************************************************************************************/
/*               A D D R E S S   L I N E S   M A N A G E M E N T    M A C R O S                     */
/****************************************************************************************************/
  #define MAmsk(A)       ( ((A<<MA012shft)|(A<<MA3shft))&MADRmsk )
  #define MODadrSet(A)   ( FIO0PIN = FIO0PIN&(~MADRmsk)|MAmsk(A) )//modul address lines set
  #define RAmsk(A)       ( (A<<RAshft)&RADRmsk )
  #define RAMadrSet(A)   ( FIO1PIN = FIO1PIN&(~RADRmsk)|RAmsk(A) )//RAM high address lines set
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/





/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
 #endif
//#endif
